//package com.pubinfo.passbook.shiro.filter;
//
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import com.alibaba.fastjson.JSON;
//import com.pubinfo.passbook.common.model.vo.base.JsonResult;
//import com.pubinfo.passbook.common.model.vo.base.ResultCode;
//import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
//import org.apache.shiro.web.util.WebUtils;
//
//import java.io.PrintWriter;
//
//public class ShiroHeaderFilter extends FormAuthenticationFilter {
//  //解决OPTIONS请求跨域问题
//  @Override
//  protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
//    if (request instanceof HttpServletRequest) {
//      if (((HttpServletRequest) request).getMethod().toUpperCase().equals("OPTIONS")) {
//        return true;
//      }
//    }
//    return super.isAccessAllowed(request, response, mappedValue);
//  }
//}